package com.chixing.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chixing.entity.Myorder;
import com.chixing.mapper.MyorderMapper;
import com.chixing.service.IMyorderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Yebken.
 * @since 2025-06-25
 */
@Service
public class MyorderServiceImpl implements IMyorderService {

    @Autowired
    private MyorderMapper myorderMapper;

    @Override
    public Page getAll(Integer pageNum,Integer customerId) {
        QueryWrapper<Myorder> wrapper = new QueryWrapper<>();
        wrapper.eq("cust_id",customerId);

        Page page = new Page(pageNum,5);

        page = myorderMapper.selectPage(page, wrapper);
        return page;
    }

}
